package com.qiwenshare.fund.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Objects;

/**
 * @ClassName FoundDayInfo
 * @Description TODO
 * @Author peng.zhang
 * @Date 16:14 2023/6/12
 * @Version 1.0
 **/
@Entity
@Data
public class FundDayInfo implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.AUTO)
    private Long id;

    private String stockName;
    private String stockNum;

    /**
     * 日期
     */
    private String date;
    /**
     * 今开
     */
    private double open;
    /**
     * 最高
     */
    private double high;
    /**
     * 最低
     */
    private double low;
    /**
     * 今收
     */
    private double close;
    /**
     * 成交量
     */
    private double volume;
    /**
     * 成交额
     */
    private double amount;
    private double ccl;
    /**
     * 昨收
     */
    private double preClose;
    /**
     * 涨幅
     */
    private double changeRatio;
    //指标
    private double k;
    private double d;
    private double j;
    private double kline;
    private double ma5;
    private double ma10;
    private double ma20;
    private double ma30;
    private double ma60;
    private double ma120;
    private double ma200;
    private double ma250;
    private double volume120;
    private double dif;
    private double dea;
    private double macd;
    private double rsi6;
    private double rsi12;
    private double rsi24;
    private double wr10;
    private double wr6;


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        FundDayInfo that = (FundDayInfo) o;
        return Objects.equals(getStockNum(), that.getStockNum()) && Objects.equals(getDate(), that.getDate());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getStockNum(), getDate());
    }
}
